package com.minimalist.basic.entity.po.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class MStorageTableDef extends TableDef {

    /**
     * 存储管理表 实体类。

 @author 小太阳
 @since 2024-10-18
     */
    public static final MStorageTableDef MSTORAGE = new MStorageTableDef();

    /**
     * ID自增
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 逻辑删除
     */
    public final QueryColumn DELETED = new QueryColumn(this, "deleted");

    /**
     * 版本号
     */
    public final QueryColumn VERSION = new QueryColumn(this, "version");

    /**
     * 创建人ID
     */
    public final QueryColumn CREATE_ID = new QueryColumn(this, "create_id");

    /**
     * 更新人ID
     */
    public final QueryColumn UPDATE_ID = new QueryColumn(this, "update_id");

    public final QueryColumn STORAGE_ID = new QueryColumn(this, "storage_id");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 更新时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 说明
     */
    public final QueryColumn DESCRIPTION = new QueryColumn(this, "description");

    /**
     * 名称
     */
    public final QueryColumn STORAGE_NAME = new QueryColumn(this, "storage_name");

    /**
     * 存储类型，用于标识存储平台，如本地、阿里云oss、七牛云oss等
     */
    public final QueryColumn STORAGE_TYPE = new QueryColumn(this, "storage_type");

    /**
     * 存储配置，JSON数据
     */
    public final QueryColumn STORAGE_CONFIG = new QueryColumn(this, "storage_config");

    /**
     * 是否默认使用这个存储，0否 1是
     */
    public final QueryColumn STORAGE_DEFAULT = new QueryColumn(this, "storage_default");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, STATUS, VERSION, CREATE_ID, UPDATE_ID, STORAGE_ID, CREATE_TIME, UPDATE_TIME, DESCRIPTION, STORAGE_NAME, STORAGE_TYPE, STORAGE_CONFIG, STORAGE_DEFAULT};

    public MStorageTableDef() {
        super("", "m_storage");
    }

    private MStorageTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    @Override
    public MStorageTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new MStorageTableDef("", "m_storage", alias));
    }

}
